package leetcode_2401_2500;

import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;

public class LeeCode_2418 {
    public static void main(String[] args) {

    }
    private static String[] sortPeople(String[] names, int[] heights) {
        int n = names.length;
        int[][] arr = new int[n][2];
        for (int i = 0; i < n; i++) {
            arr[i][0] = heights[i];
            arr[i][1] = i;
        }
        Arrays.sort(arr, (o1, o2) -> o2[0] - o1[0]);
        String[] ans= new String[n];
        for (int i = 0; i < n; i++) {
            ans[i] = names[arr[i][1]];
        }
        return ans;
    }
}
